<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<meta charset="UTF-8">
    <link rel="stylesheet" href="${initParam.root}css/table.css" type="text/css">
    <link rel="stylesheet" href="${initParam.root}css/button.css" type="text/css">
    
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<jsp:useBean id="toDay" class="java.util.Date" />

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.0.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#category").change(function() {
			var category = $("#category").val();
			if (category == "") {
				alert("카테고리를 선택하세요.");
				return false;
			}
		});
	});
</script>
<form method="post" id="regiForm" enctype="multipart/form-data"  action="${initParam.root}seller/registerDeal.do">
<table class="registerMemberTable"  style="margin: 0 auto ; width: 500px" >
<tr>
<td>상품명</td>
<td><input type="text" name="dealTitle" required></td>
</tr>
<tr>
<td>카테고리
</td>
<td>	<select name="category">
		<option value="">----</option>
		<c:forEach items="${requestScope.categoryKind }" var="category">
		<option value="${category}">${category}</option>
		</c:forEach>
	</select> </td>
</tr>
<tr>
<td>등록자</td>
<td><input type="text" name="sellerId" readonly="readonly" value="${sessionScope.login.sellerId}"></td>
</tr>
<tr>
<td>상품가격</td>
<td><input type="text" name="dealPrice"required></td>
</tr>
<tr>
<td>상품수량</td>
<td><input type="text" name="dealCount"required></td>
</tr>
<tr>
<td>마감일</td>
<td>
<input type="date" min=<fmt:formatDate value="${toDay}" pattern="yyyy-MM-dd" /> max="2020-12-31" name="dealEndDate" required></td>
</tr>
<tr>
<td>이미지</td>
<td><input type="file" name="uploadFile"required></td>
</tr>
<tr>
<td colspan=2><input type="submit" value="상품등록" class="submit"></td>
</tr>
</table>
</form> 
